// 魔方每个小块的初始位置(以魔方中心为原点，单位为1)，魔方从正前方看，从左上到右下下标依次从0到8，然后再往后面一层，继续如此编号，直到26
export const initPositionList = [
  { x: -1, y: 1, z: 1 },
  { x: 0, y: 1, z: 1 },
  { x: 1, y: 1, z: 1 },
  { x: -1, y: 0, z: 1 },
  { x: 0, y: 0, z: 1 },
  { x: 1, y: 0, z: 1 },
  { x: -1, y: -1, z: 1 },
  { x: 0, y: -1, z: 1 },
  { x: 1, y: -1, z: 1 },
  { x: -1, y: 1, z: 0 },
  { x: 0, y: 1, z: 0 },
  { x: 1, y: 1, z: 0 },
  { x: -1, y: 0, z: 0 },
  { x: 0, y: 0, z: 0 },
  { x: 1, y: 0, z: 0 },
  { x: -1, y: -1, z: 0 },
  { x: 0, y: -1, z: 0 },
  { x: 1, y: -1, z: 0 },
  { x: -1, y: 1, z: -1 },
  { x: 0, y: 1, z: -1 },
  { x: 1, y: 1, z: -1 },
  { x: -1, y: 0, z: -1 },
  { x: 0, y: 0, z: -1 },
  { x: 1, y: 0, z: -1 },
  { x: -1, y: -1, z: -1 },
  { x: 0, y: -1, z: -1 },
  { x: 1, y: -1, z: -1 },
];

// 魔方初始各个面各小块对应的下标值，魔方从正前方看，从左上到右下下标依次从0到8，然后再往后面一层，继续如此编号，直到26
export const planeIndexList = {
  front: [0, 1, 2, 3, 4, 5, 6, 7, 8],
  back: [20, 19, 18, 23, 22, 21, 26, 25, 24],
  top: [18, 19, 20, 9, 10, 11, 0, 1, 2],
  bottom: [6, 7, 8, 15, 16, 17, 24, 25, 26],
  left: [18, 9, 0, 21, 12, 3, 2415, 6],
  right: [2, 11, 20, 5, 14, 23, 8, 17, 26],
};

// 魔方各个面各小块相对该面的位置(以该面中心为原点，单位为1)
export const position2PlaneList = {
  front: [
    { x: -1, y: 1, z: 0 },
    { x: 0, y: 1, z: 0 },
    { x: 1, y: 1, z: 0 },
    { x: -1, y: 0, z: 0 },
    { x: 0, y: 0, z: 0 },
    { x: 1, y: 0, z: 0 },
    { x: -1, y: -1, z: 0 },
    { x: 0, y: -1, z: 0 },
    { x: 1, y: -1, z: 0 },
  ],
  back: [
    { x: 1, y: 1, z: 0 },
    { x: 0, y: 1, z: 0 },
    { x: -1, y: 1, z: 0 },
    { x: 1, y: 0, z: 0 },
    { x: 0, y: 0, z: 0 },
    { x: -1, y: 0, z: 0 },
    { x: 1, y: -1, z: 0 },
    { x: 0, y: -1, z: 0 },
    { x: -1, y: -1, z: 0 },
  ],
  top: [
    { x: -1, y: 0, z: -1 },
    { x: 0, y: 0, z: -1 },
    { x: 1, y: 0, z: -1 },
    { x: -1, y: 0, z: 0 },
    { x: 0, y: 0, z: 0 },
    { x: 1, y: 0, z: 0 },
    { x: -1, y: 0, z: 1 },
    { x: 0, y: 0, z: 1 },
    { x: 1, y: 0, z: 1 },
  ],
  bottom: [
    { x: -1, y: 0, z: 1 },
    { x: 0, y: 0, z: 1 },
    { x: 1, y: 0, z: 1 },
    { x: -1, y: 0, z: 0 },
    { x: 0, y: 0, z: 0 },
    { x: 1, y: 0, z: 0 },
    { x: -1, y: 0, z: -1 },
    { x: 0, y: 0, z: -1 },
    { x: 1, y: 0, z: -1 },
  ],
  left: [
    { x: 0, y: 1, z: -1 },
    { x: 0, y: 1, z: 0 },
    { x: 0, y: 1, z: 1 },
    { x: 0, y: 0, z: -1 },
    { x: 0, y: 0, z: 0 },
    { x: 0, y: 0, z: 1 },
    { x: 0, y: -1, z: -1 },
    { x: 0, y: -1, z: 0 },
    { x: 0, y: -1, z: 1 },
  ],
  right: [
    { x: 0, y: 1, z: 1 },
    { x: 0, y: 1, z: 0 },
    { x: 0, y: 1, z: -1 },
    { x: 0, y: 0, z: 1 },
    { x: 0, y: 0, z: 0 },
    { x: 0, y: 0, z: -1 },
    { x: 0, y: -1, z: 1 },
    { x: 0, y: -1, z: 0 },
    { x: 0, y: -1, z: -1 },
  ],
};

// 魔方各个面各小块对应的位置(以魔方中心为原点，单位为1)
export const position2RubiksCubeList = {
  front: [
    { x: -1, y: 1, z: 1 },
    { x: 0, y: 1, z: 1 },
    { x: 1, y: 1, z: 1 },
    { x: -1, y: 0, z: 1 },
    { x: 0, y: 0, z: 1 },
    { x: 1, y: 0, z: 1 },
    { x: -1, y: -1, z: 1 },
    { x: 0, y: -1, z: 1 },
    { x: 1, y: -1, z: 1 },
  ],
  back: [
    { x: 1, y: 1, z: -1 },
    { x: 0, y: 1, z: -1 },
    { x: -1, y: 1, z: -1 },
    { x: 1, y: 0, z: -1 },
    { x: 0, y: 0, z: -1 },
    { x: -1, y: 0, z: -1 },
    { x: 1, y: -1, z: -1 },
    { x: 0, y: -1, z: -1 },
    { x: -1, y: -1, z: -1 },
  ],
  top: [
    { x: -1, y: 1, z: -1 },
    { x: 0, y: 1, z: -1 },
    { x: 1, y: 1, z: -1 },
    { x: -1, y: 1, z: 0 },
    { x: 0, y: 1, z: 0 },
    { x: 1, y: 1, z: 0 },
    { x: -1, y: 1, z: 1 },
    { x: 0, y: 1, z: 1 },
    { x: 1, y: 1, z: 1 },
  ],
  bottom: [
    { x: -1, y: -1, z: 1 },
    { x: 0, y: -1, z: 1 },
    { x: 1, y: -1, z: 1 },
    { x: -1, y: -1, z: 0 },
    { x: 0, y: -1, z: 0 },
    { x: 1, y: -1, z: 0 },
    { x: -1, y: -1, z: -1 },
    { x: 0, y: -1, z: -1 },
    { x: 1, y: -1, z: -1 },
  ],
  left: [
    { x: -1, y: 1, z: -1 },
    { x: -1, y: 1, z: 0 },
    { x: -1, y: 1, z: 1 },
    { x: -1, y: 0, z: -1 },
    { x: -1, y: 0, z: 0 },
    { x: -1, y: 0, z: 1 },
    { x: -1, y: -1, z: -1 },
    { x: -1, y: -1, z: 0 },
    { x: -1, y: -1, z: 1 },
  ],
  right: [
    { x: 1, y: 1, z: 1 },
    { x: 1, y: 1, z: 0 },
    { x: 1, y: 1, z: -1 },
    { x: 1, y: 0, z: 1 },
    { x: 1, y: 0, z: 0 },
    { x: 1, y: 0, z: -1 },
    { x: 1, y: -1, z: 1 },
    { x: 1, y: -1, z: 0 },
    { x: 1, y: -1, z: -1 },
  ],
};
